#include "SemanticNodeBlockArrive.h"

/**
 *  @fn	SemanticNodeBlockArrive::SemanticNodeBlockArrive(const SyntaxTreeNode *arriveNodeParent,
 *  	SemanticNode *parent)
 * 
 *  @brief	Constructor. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	arriveNodeParent	If non-null, the arrive node parent.
 *  @param	parent				If non-null, the parent.
 */
SemanticNodeBlockArrive::SemanticNodeBlockArrive(const SyntaxTreeNode *arriveNodeParent, SemanticNode *parent) : SemanticNode(parent), LabeledNode(arriveNodeParent->Nodes->GetData(0)) {
	adtableExpression = NULL;
}
/**
 *  @fn	void SemanticNodeBlockArrive::setADTable(SemanticNodeExpression *adtable)
 * 
 *  @brief	Sets a d table. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	adtable	If non-null, the adtable.
 */
void SemanticNodeBlockArrive::setADTable(SemanticNodeExpression *adtable) {
	adtableExpression = adtable;
}
/**
 *  @fn	std::string SemanticNodeBlockArrive::toDebugString(int tab)
 * 
 *  @brief	Converts a tab to a debug string. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	tab	The tab.
 * 
 *  @return	This object as a std::string.
 */
std::string SemanticNodeBlockArrive::toDebugString(int tab) {
	std::ostringstream res;
	for (int i = 0; i < tab; i++) res << DEBUG_STRING_RAZMAK;
	res << getLabelsDebugString() << ": arrive" << std::endl;
	if (adtableExpression != NULL) res << ((SemanticNode *)(adtableExpression))->toDebugString(tab + 1);
	return res.str();
}
